﻿@page "/SchedulerRecurringAppointments"
@using DevExpress.Blazor

<div class="demo-description">
    <h2>Scheduler - Recurring Appointments</h2>
    <p>
        This module demonstrates how to set up recurring appointments for the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxScheduler">Scheduler</a> component. Note that the appointment object should contain the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxSchedulerRecurrenceInfo">DxSchedulerRecurrenceInfo</a> field (see the code below) to use this functionality.
    </p>
</div>

<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage"
             ActiveViewType="SchedulerViewType.WorkWeek"
             CssClass="mw-1100">
    <DxSchedulerDayView VisibleTime="@VisibleTime"></DxSchedulerDayView>
    <DxSchedulerWorkWeekView VisibleTime="@VisibleTime"></DxSchedulerWorkWeekView>
    <DxSchedulerWeekView VisibleTime="@VisibleTime"></DxSchedulerWeekView>
</DxScheduler>
<CodeSnippet_Scheduler_RecurringAppointments></CodeSnippet_Scheduler_RecurringAppointments>

@code {
    DxSchedulerTimeSpanRange VisibleTime = new DxSchedulerTimeSpanRange(TimeSpan.FromHours(8), TimeSpan.FromHours(19));

    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        AppointmentsSource = RecurringAppointmentCollection.GetAppointments(),
        AppointmentMappings = new DxSchedulerAppointmentMappings() {
            Type = "AppointmentType",
            Start = "StartDate",
            End = "EndDate",
            Subject = "Caption",
            AllDay = "AllDay",
            Location = "Location",
            Description = "Description",
            LabelId = "Label",
            StatusId = "Status",
            RecurrenceInfo = "Recurrence"
        }
    };
}
